<?php
require_once 'common.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Online PC</title>
        <link rel="stylesheet" href="css/style.css" type="text/css" />
        <link rel="stylesheet" href="css/jquery-ui-1.8.11.custom.css" type="text/css" />

        <script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.11.custom.min.js"></script>

        <script type="text/javascript" src="js/hint.js"></script>

        <script type="text/javascript" src="js/common.js"></script>

        <script type="text/javascript" src="fck/ckeditor.js"></script>
        <script type="text/javascript" src="js/ajaxupload.3.5.js" ></script>
        
    </head>
    <body style="background: transparent url(images/background_inside.png) no-repeat center top;">
        <table cellspacing="0" cellpadding="0" border="0" width="900" style="margin-left: auto; margin-right: auto;">
            <tr>
                <td valign="middle" style="height: 130px;">
                    <?php banner('register'); ?>
                </td>
            </tr>
            
            <tr>
                <td valign="middle" style="height: 52px;">
                    <?php login(); ?>
                </td>
            </tr>
            <tr><td style="height: 50px;"></td></tr>
            <tr>
                <td valign="top" style="height: 500px;">
                    <table cellspacing="0" cellpadding="0" border="0" width="100%">
                        <tr>
                            <td valign="top">
                                <table cellspacing="0" cellpadding="0" border="0" width="100%">
                                    <tr>
                                        <td style="border-bottom: 1px solid #f0f0f0; height: 27px;" valign="top"><h3 style="margin: 0px;">Upload Product</h3></td>
                                    </tr>
                                    <tr>
                                        <td valign="top">

                                            <table cellspacing="3" cellpadding="5" border="0" id="table1" width="100%">
                                                <tr><td colspan="3" height="20"><div id="msg"></div></td></tr>
                                                <tr>

                                                    <td class="pd" colspan="3"><b>Title <small>(Maximum 200-Characters)</small>:</b><br/>
                                                        <input type="text" class="rounded_corner" id="txtadtitle" name="txtadtitle" style="width: 500px;" maxlength="200" /> <font color="#ff0000">*</font> </td>
                                                </tr>
                                                <tr>
                                                    <td class="pd" style="height: 35px;"><b>Ad Type:</b><br/>

                                                        <input type="radio" id="rdoadtype" name="rdoadtype" checked="checked"  value="0" /> Offer
                                                        <input type="radio" id="rdoadtype" name="rdoadtype" value="1" /> Want &nbsp;&nbsp;&nbsp;&nbsp;<font color="#ff0000">*</font>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="pd"><b>Category:</b><br/>
                                                    <?php
                                                        $categoryClass->setComboQuery();
                                                        echo $categoryClass->getComboBox("cboCategory",null,"-----Select Category -------",'Style="width: 510px;" id="cboCategory"');
                                                    ?>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="pd"><b>SubCategory:</b><br/>
                                                        <div style="height: 35px;" id="subcat_container">
                                                        <select style="width: 510px;">
                                                            <option value="0">-----Select SubCategory -------</option>
                                                        </select> <font color="#ff0000">*</font>
                                                        </div>

                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="pd"><b>Price:</b><br/>
                                                        <input type="text" class="rounded_corner" id="txtprice" name="txtprice" style="width: 178px;" maxlength="10" />&nbsp;&nbsp;
                                                    </td>
                                                </tr>

                                                <tr>
                                                    <td class="pd"><b>Description:</b> <font color="#ff0000">*</font> <br/>
                                                        <textarea onkeydown="textCounter2(document.getElementById('desc'),document.getElementById('grLenght2'),5000);" onkeyup="textCounter2(document.getElementById('desc'),document.getElementById('grLenght2'),5000);" name="desc" id="desc" class="desc"></textarea>
                                                        <p>Length: <input readonly="readonly"  type="text" id="grLenght2" name="grLenght2" size="3" maxlength="3" value="0" /> (Maximum <b>5000</b> characters)</p>

                                                        <script type="text/javascript">
                                                            $(window).load(function() {
                                                                CKEDITOR.replace( 'desc',
                                                                {
                                                                    skin : 'office2003',
                                                                    height:"300", width:"800",
                                                                    toolbar :
                                                                    [
                                                                        ['Styles', 'Format'],
                                                                        ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', '-', 'RemoveFormat','Image','Flash','Table'],
                                                                        ['Bold','Italic','Strike','NumberedList','BulletedList','-'],
                                                                        ['Link','Unlink']
                                                                    ]
                                                                });
                                                                function textCounter2(field, countfield, maxlimit)
                                                                {
                                                                    if (field.value.length > maxlimit) // if too long...trim it!
                                                                        field.value=field.value.substring(0, maxlimit);
                                                                    else  // otherwise, update counter
                                                                        countfield.value=field.value.length;
                                                                }
                                                                var editor = CKEDITOR.instances.desc;
                                                                editor.on( 'key', function( evt ){
                                                                    // Update the counter with text length of editor HTML output.
                                                                    textCounter2( { value : evt.editor.getData() },document.getElementById('grLenght2'), 5000 );
                                                                }, editor.element.$ );
                                                                // Whether content has exceeded the maximum characters.
                                                                var locked;
                                                                editor.on( 'key', function( evt ){

                                                                    var currentLength = editor.getData().length,
                                                                    maximumLength = 5000;
                                                                    if( currentLength >= maximumLength )
                                                                    {
                                                                        if ( !locked )
                                                                        {
                                                                            // Record the last legal content.
                                                                            editor.fire( 'saveSnapshot' ), locked = 1;
                                                                            // Cancel the keystroke.
                                                                            evt.cancel();
                                                                        }
                                                                        else
                                                                        // Check after this key has effected.
                                                                            setTimeout( function()
                                                                        {
                                                                            // Rollback the illegal one.
                                                                            if( editor.getData().length > maximumLength )
                                                                                editor.execCommand( 'undo' );
                                                                            else
                                                                                locked = 0;
                                                                        }, 0 );
                                                                    }
                                                                });
                                                            });
                                                        </script>
                                                        
                                                    </td>
                                                </tr>
                                                
                                                <tr>
                                                    <td class="pd"><input type="button" class="rounded_corner" id="btnupload" style="width: 80px;" value="Next &raquo;"  /></td>
                                                </tr>
                                                <tr><td height="30"></td></tr>

                                            </table>


                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr><td style="height: 10px;"></td></tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>

                </td>
            </tr>
        </table
        <?php footer() ?>
    </body>
</html>